package com.niit.pys.repository;



import com.niit.pys.bean.Book;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;




public interface BookRepository extends CrudRepository<Book, Integer> {
    @Modifying
    @Transactional
    @Query("delete from Book b where b.book_id = :book_id")
    void deleteBookById(Integer book_id);
    @Query("from Book b where b.book_id = :book_id")
    Book findBookByid(@Param("book_id") String book_id);
}
